import type { ISlider } from '@/types/api/home';
<script lang="ts" setup>
import { ref } from 'vue'
import { findBanner } from '@/api/home'
import type { ISlider } from '@/types/api/home'

// 轮播图数据
const sliders = ref<ISlider[]>([])
// 获取轮播图数据
findBanner().then((res) => {
  sliders.value = res.data.result
})
</script>

<template>
  <div class="home-banner">
    <XtxSlider :sliders="sliders" :autoPlay="true" />
  </div>
</template>

<style lang="scss" scoped>
.home-banner {
  width: 1240px;
  height: 500px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 98;
}

.xtx-carousel {
  :v-deep(.carousel-btn.prev) {
    left: 270px;
  }
  :v-deep(.carousel-indicator) {
    padding-left: 250px;
  }
}
</style>
